<?php
/**
 * 朋友代付model
 * User: Administrator
 * Date: 2017/8/17
 * Time: 14:32
 */
defined('InNcPHP') or exit('Access Invalid!');

class bargain_paidModel  extends Model {


    public function __construct()
    {
        parent::__construct('bargain_paid');
    }



    /**
     * 获取代付列表列表分页
     * @param array $condition
     * @param string $field
     * @param int $page
     * @param string $order
     * @return mixed
     */
    public function getBgpaidPage($condition = array(), $field = '*', $page = 0, $order = 'paid_id desc'){
        return $this->field($field)->where($condition)->page($page)->order($order)->select();
    }

    /**
     * 获取一条记录的详细信息
     * @param array $condition
     * @param string $field
     * @return mixed
     */
    public function getBargainpaidInfo($condition = array(), $field = '*'){

        return $this->field($field)->where($condition)->find();

    }

    /**
     * 插入一条记录
     * @param array $params
     * @return mixed
     */
    public function addBgpaid($params)
    {
        return $this->insert($params);
    }

    /**
     * 删除活动记录
     * @param array $condition
     */
    public function delBgpaid($condition){

        return $this->where($condition)->delete();
    }

    /**
     * 编辑
     * @param array $condition
     *  @param array $param
     */
    public function updateBarginpaid($condition, $param){

        return $this->where($condition)->update($param);


    }

    /**
     * 取得条数
     * @param array $condition
     */

    public function getBarginpaidcount($condition){
        return $this->where($condition)->count();
    }

}